<extend name="Base/common"/>
<block name="style">
    <style>
		.jumbotron {
			padding: 0 0;
			margin-bottom: 0;
			color: #ffffff;
		}
		.jumbotron p {
			padding: 0 5px;
			font-size: 14px;
			color: #ffffff;
		}
		.owl-theme {
			padding-left: 10px;
			padding-right: 10px;
		}
		.texing {
			padding-left: 0;
			padding-right: 0;
		}
		.texing .thumbnail {
			padding: 4px;
			line-height: 1.42857143;
			background-color: #f2f2f2;
			border: 1px solid #fff;
			border-radius: 3px;
			-webkit-transition: border .2s ease-in-out;
			margin-bottom: 0;
		}
		.texing .thumbnail p {
			padding: 0 5px;
		}
		.feature-title {
			margin-bottom: 15px;
		}
		.feature-list .thumbnail .lazy {
			width: 100%;
			height: 126px;
		}
		.feature-list .thumbnail .caption p {
			height: 80px;
			overflow: hidden;
		}
		@media (max-width: 768px) {
			#my-slide .btn {
				margin-bottom: 0px;
			}
			.feature-list .thumbnail .caption p {
				height: auto;
			}
		}
		.btn-default-inverse {
			color: #fff;
			border-color: #fff;
			text-shadow: none;
		}
		.btn-default-inverse:hover, .btn-default-inverse.hover, .btn-default-inverse.active {
			color: #333;
			background: #fff;
		}
		.slider_text {
			width: 460px;
			line-height: 32px;
		}
		
		.breadcrumb {
            margin-bottom: 0px;
            padding-left: 0;
            font-size: 18px;
        }
        .topic_title {
            color: #505050;
        }
        .topic_title_count {
            padding-top: 20px;
        }
        .topic_title {
            color: #626770;
            padding: 7px 15px;
        }
        .pull-right {
            float: right !important;
        }
        .topic_title_count p {
            font-size: 16px;
            margin-top: 16px;
            margin-right: 10px;
        }
        .topic_title p {
            font-size: 18px;
        }
    </style>
</block>
<block name="header">
    <div class="container-fluid" style="padding-right: 0;padding-left: 0;">
        <header class="row topic_title" id="overview">
            <div class="col-md-12 col-sm-12">
                <ol class="breadcrumb">
                    <li>
                        <a href="{:U('Index/index')}">首页</a>
                    </li>
                    <li class="active">
                        <a href="{:U('Wx/vindex/',array('vid'=>$info['vid'],'token'=>$token,'openid'=>$openid))}">定向越野最佳人气投票</a>
                    </li>
                </ol>
            </div>
        </header>
    </div>
</block>
<block name="body">
    <div class="row feature-list" style="margin-right:0;margin-left:0;">
        <volist name="lists" id="list">
            <div class="col-xs-12 col-sm-4 col-md-3 texing">
                <div class="thumbnail">
                    <div class="caption">
                        <h3 class="text-center"><a href="{:U('Wx/vote/',array('id'=>$list['id'],'token'=>$token,'openid'=>$openid))}">{$list['title']}
                        <br>
                        <if condition="$uinfo['subscribe'] eq 0"><small>微信公众号：wwwiiccn</small><br></if>
                        <small>微信回复：投票{$list['identifier']}</small></a></h3>
                        <h4 class="text-center"> 目前 <span id="vote_{$list['id']}">{$list['vote']}</span> 票 </h4>
                                        <button class="btn btn-primary btn-block" type="button" onclick="vote({$list['id']});">
                            为该队送上一票
                        </button>
                    </div>
                </div>
            </div>
        </volist>
    </div>
</block>

<block name="script">
    <script>
        function vote(id) {
            var token = '{$token}';
            var openid = '{$openid}';
            var url='{:U("Wx/vlog")}';
            data={'token':token,'openid':openid,'id':id};
            $.ajax({
                url :url,
                timeout:3000,
                dataType :'JSON',
                type:'POST',
                data:data,
                success : function(msg) {
                    if(msg.status==1){
                        $('#vote_'+msg.id).html(msg.vote);
                    }
                    alert(msg.msg);
                },
                error:function(){
                    alert('网络连接超时。');
                }
            });
        }
    </script>
</block>